﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc.Filters;
using System.Web.Mvc.Routing;

namespace First.Filter
{
    public class MyActionAttribute: ActionFilterAttribute
    {
        public string role { get; set; }
        //public override void OnActionExecuting(ActionExecutingContext filterContext)
        //{
        //    // base.OnActionExecuting(filterContext);
        //    HttpCookie httpCookie = filterContext.HttpContext.Request.Cookies.Get("userRole");
        //    string userrole= httpCookie.Value;
        //    if (userrole.ToLower() != role.ToLower())
        //    {
        //        filterContext.HttpContext.Response.StatusCode = 403;
        //        filterContext.HttpContext.Response.Write("没有权限");
        //        filterContext.HttpContext.Response.End();
        //    }
        //}
    }
}